define(
  ['jquery',
   'GlobalInfo',
   'bootstrap'
  ],
function($, GlobalInfo){
  $(function(){
    var nav= "<div class='navbar-inner'>"+
             "<div class='container'>"+
               "<a class='btn btn-navbar' data-toggle='collapse' data-target='.nav-collapse'>"+
                 "<span class='icon-bar'></span>"+
                 "<span class='icon-bar'></span>"+
                 "<span class='icon-bar'></span>"+
               "</a> <!-- / boton de colapsar -->"+
               "<span class='brand'>SISCON</span>"+
               "<div class='nav-collapse'>"+
                    "<ul class='nav pull-right'>"+        
                        "<li><a href='homePageDirector.html'><i class='icon-home icon-white'></i> Inicio</a></li>"+
                        "<li id='searches' style='display:none;'><a href='searches.html'><i class='icon-search icon-white'></i>B&uacute;squedas</a></li>"+
                        "<li id='administration' style='display:none;' class='dropdown'><a href='#' data-toggle='dropdown' class='dropdown-toggle'><i class='icon-cog icon-white'></i>Administraci&oacute;n<b class='caret'></b></a>"+
                            "<ul class='dropdown-menu'>"+
                                "<li id='roles' style='display:none;'><a href='permisos.html'>Administrar roles</a></li>"+
                                "<li id='users' style='display:none;'><a href='users.html'>Administrar usuarios</a></li>"+
                            "</ul>"+
                        "</li>"+
                        "<li id='uploads' style='display:none;'><a href='uploads.html'><i class='icon-upload icon-white'></i>Subir Archivos<b class='caret'></b></a></li>"+  
                        "<li><a id='logout' href='#' data-toggle='dropdown' class='dropdown-toggle'><i class='icon-off icon-white'></i> Cerrar Sesi&oacute;n</a></li>"+  
                    "</ul>"+
               "</div> <!-- /nav-collapse -->"+
             "</div> <!-- /.container -->"+
           "</div> <!-- /navbar-inner -->"+
         "</div> <!-- /navbar -->";
    $("#navG").append(nav);

    if(GlobalInfo.RequireRole(GlobalInfo.Role.ROLES, GlobalInfo.Role.READ_ACCESS)){
        $("#administration").css('display', '');
        $("#roles").css('display', '');
    }

    if(GlobalInfo.RequireRole(GlobalInfo.Role.USERS, GlobalInfo.Role.READ_ACCESS)){
        $("#administration").css('display', '');
        $("#users").css('display', '');
    }

    if(GlobalInfo.RequireRole(GlobalInfo.Role.UPLOADS, GlobalInfo.Role.WRITE_ACCESS)){
        $("#uploads").css('display', '');
    }

    if(
        GlobalInfo.RequireRole(GlobalInfo.Role.TEACHERS, GlobalInfo.Role.READ_ACCESS)
    ||  GlobalInfo.RequireRole(GlobalInfo.Role.COURSES, GlobalInfo.Role.READ_ACCESS)
    ||  GlobalInfo.RequireRole(GlobalInfo.Role.CLASSROOMS, GlobalInfo.Role.READ_ACCESS)
    )
    {
        $("#searches").css('display', '');
    }

    $('#logout').click(function(){
        GlobalInfo.Logout();
    });
    $(".brand").click(function(){
      GlobalInfo.Redirect("homePageDirector.html");
    });
  });
});